<template>
  <div class="header">
    我的头像
  </div>
  <div class="content">
    <div class="edit" @click="toUpload()">
      更换头像
    </div>
    <div class="box">
      <div class="pic">
        <img :src="currentAvatar" alt="" width="120">
      </div>
    </div>
  </div>
</template>
<script setup>
import {useRouter} from "vue-router";
import {useUserStore} from "@/stores/userInfoStore.js";
import {onMounted, ref} from "vue";

const router = useRouter()
const currentAvatar = ref()
onMounted(() => {
  currentAvatar.value = useUserStore().userInfo.userAvatar
})
const toUpload = () => {
  router.push("/account/upload")
}
</script>
<style lang="scss" scoped>
.header{
  height: 56px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  padding-left: 50px;
  padding-top: 16px;
  color: #2ae6ff;
}
.content{
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  .edit{
    width: 60px;
    height: 60px;
    background-color: deepskyblue;
    border-radius: 50%;
    box-sizing: border-box;
    padding: 12px;
    color: white;
    display: flex;justify-content: center;align-items: center;
    position: relative;
    left: 30px;
    cursor: pointer;
  }
  .box{
    width: 250px;
    height: 250px;
    //background-color: blue;
    border-radius: 50%;
    border: 1px solid #e3e3e3;
    display: flex;
    justify-content: center;align-items: center;
    .pic{
      width: 120px;
      height: 120px;
      border-radius: 50%;
      overflow: hidden;
    }

  }
}
</style>